import fetch from '@/utils/fetch';
import { EBIZ_API } from '@/config/baseUrl';

export function getCommodityList(params) {
	return fetch({
	    url: EBIZ_API + '/appAdmin_goods/list.do',
	    method: 'get',
	    
	    params
  	})
}

export function getCommerceDetail(id) {
	return fetch({
	    url: EBIZ_API + `/appAdmin_goods/getInfo.do?GOODS_ID=${id}`,
	    method: 'get'
  	})
}

export function CommodityCommerce(data) {
	return fetch({
		url: EBIZ_API + '//appAdmin_goods/save.do',
		method: 'post',
		data
	})
}
export function getJumpValue(params) {
	return fetch({
	    url: EBIZ_API + '//appAdmin_category/listAll.do',
	    method: 'post',
	    params
  	})
}
export function deletethis(data) {
	return fetch({
		url: EBIZ_API + '/appAdmin_goods/delete2.do',
		method: 'post',
		data
	})
}
export function modifyCell(id, data) {
	return fetch({
	    url: `/uc/v1/mgt/cell/${id}`,
	    method: 'patch',
	    data
	})
}
export function soldout(data) {
	return fetch({
		url: EBIZ_API + '/appAdmin_goods/delete.do',
		method: 'post',
		data
	})
}
export const hot = { //省     	
	
	"": "是否热卖",
	"0": "否",
	"1": "是"
	
	
};
export const cancel = { //省     	
	
	"0": "未删除",
	"1": "已删除"
	
	
};
export const best = { //省     	
	
	"": "是否精品",
	"0": "否",
	"1": "是"
	
	
};
export const onsale = { //省     	
	
	"": "是否上架",
	"0": "否",
	"1": "是"
	
	
};
export const commodity = { //省     	
	
	"2": "餐饮商品",
	"3": "团购商品",
	"1": "超市商品"
	
	
};
export const storename = { //省     	
	
	"1": "百家乐超市",
	"4": "天天超市分店",
	"5": "天天超市"
	
	
};

export const two = { //省     	
	
	"4": "新鲜水果",
	"5": "速冻食品",
	"28": "555",
	"29": "2",
	"31": "6",
	"32": "其他"
	
	
};
export const two_o = { //省     	
	"": "所有二级分类",
	"4": "新鲜水果",
	"5": "速冻食品",
	"28": "555",
	"29": "2",
	"31": "6",
	"32": "其他"
	
	
};
export const twot_o = { //省     	
	"": "所有二级分类",
	"16": "品质水果",
	"17": "品牌清仓"
	
	
};

//拉取电商超市商品二级分类
export function getTwoList(data){
	return fetch({
		url: EBIZ_API+"/appAdmin_category/listAll.do",
		method:"post",
		data
	})
}